from selenium import webdriver


class BasePage():
    ''' 页面类基类 '''
    def __init__(self, driver):
        driver = webdriver.Chrome()
        self.driver = driver
        self.time = 20

    def open(self, url):
        ''' 打开url '''
        self.driver.get(url)
        self.driver.implicitly_wait(20)

    def find_element(self, loc):
        ''' 查找元素 '''
        return self.driver.find_element(*loc)

    def quit(self):
        ''' 退出 '''
        self.driver.quit()
